<?
include"../inc/config.inc.php";
if($_POST[MODE]=="ADD")
{
$level_id=$_POST[level_id];
$level=$_POST[level];
$room=$_POST[room];
$teach_id=$_POST[teach_id];
$sql="insert into level(level_id,level,room,teach_id) values('$level_id','$level','$room','$teach_id')";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=level.php'>";
}
if($_GET[MODE]=="DEL")
{
$level_id=$_GET[level_id];
$level=$_GET[level];
$room=$_GET[room];
$teach_id=$_GET[teach_id];
$sql="delete from level where level_id='$level_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=level.php'>";
}
if($_POST[MODE]=="EDIT")
{
$level_id=$_POST[level_id];
$level=$_POST[level];
$room=$_POST[room];
$teach_id=$_POST[teach_id];
$sql="UPDATE level set level_id='$level_id',level='$level',room='$room',teach_id='$teach_id' where level_id='$level_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=level.php'>";
}
?>